home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / OptionalDataException.java < prev    next >
Text File  |  1998-09-22  |  2KB  |  60 lines

  1. /*
  2.  * %W% %E%
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.io;
  15.  
  16. /**
  17.  * Unexpected data appeared in an ObjectInputStream trying to read
  18.  * an Object.
  19.  * This exception occurs when the stream contains primitive data
  20.  * instead of the object expected by readObject.
  21.  * The eof flag in the exception is true to indicate that no more
  22.  * primitive data is available.
  23.  * The count field contains the number of bytes available to read.
  24.  *
  25.  * @author  unascribed
  26.  * @version %I%, %G%
  27.  * @since   JDK1.1
  28.  */
  29. public class OptionalDataException extends ObjectStreamException {
  30.     /*
  31.      * Create an <code>OptionalDataException</code> with a length.
  32.      */
  33.     OptionalDataException(int len) {
  34.     eof = false;
  35.     length = len;
  36.     }
  37.  
  38.     /*
  39.      * Create an <code>OptionalDataException</code> signifing no
  40.      * more primitive data is available.
  41.      */    
  42.     OptionalDataException(boolean end) {
  43.     length = 0;
  44.     eof = end;
  45.     }
  46.     
  47.     /**
  48.      * The number of bytes of primitive data available to be read
  49.      * in the current buffer.
  50.      * @since   JDK1.1
  51.      */
  52.     public int length;
  53.  
  54.     /**
  55.      * True if there is no more data in the buffered part of the stream.
  56.      * @since   JDK1.1
  57.      */
  58.     public boolean eof;
  59. }
  60.